<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
</head>
</head>
<body>
    <div id="app">
        请输入内容 : <input type="text" v-model="msg">

        <button @click="addData">点击我,把值放到数据区域</button>

        <ul>
            <li v-for="(item,index) of list">
                {{item}}
            </li>
        </ul>
    </div>
    <script>
        new Vue({
            el : '#app',
            data : {
                msg : '',
                list : ['璇璇','老婆','傻瓜']
            },
            methods : {
                addData(){
                    this.list.push(this.msg);
                    this.msg = '';
                }

            }


        })
    
    </script>
</body>
</html>